import type { AppRouteModule } from '@/router/types';

import { LAYOUT } from '@/router/constant';
import { t } from '@/hooks/web/useI18n';

const homeRoute: AppRouteModule = {
  path: '/spu',
  name: 'spu',
  component: LAYOUT,
  redirect: '/spu/category',
  meta: {
    orderNo: 90002,
    roles: ['/spu'],
    icon: 'fluent-mdl2:product',
    title: t('routes.spu.spu'),
  },
  children: [
    {
      path: 'category',
      name: 'Category',
      component: () => import('@/views/spu/category/index.vue'),
      meta: {
        roles: ['/spu/category'],
        title: t('routes.spu.category'),
      },
    },
    {
      path: 'bizMetaAttr',
      name: 'BizMetaAttr',
      component: () => import('@/views/spu/bizMetaAttr/index.vue'),
      meta: {
        roles: ['/spu/bizMetaAttr'],
        title: t('routes.spu.bizMetaAttr'),
      },
    },
    {
      path: 'bizMetaAttrRule',
      name: 'BizMetaAttrRule',
      component: () => import('@/views/spu/bizMetaAttrRule/index.vue'),
      meta: {
        roles: ['/spu/bizMetaAttrRule'],
        title: t('routes.spu.bizMetaAttrRule'),
      },
    },
    {
      path: 'spuManage',
      name: 'SpuManage',
      component: () => import('@/views/spu/spu/index.vue'),
      meta: {
        roles: ['/spu/spuManage'],
        title: t('routes.spu.spuManage'),
      },
    },
    {
      path: 'materialQuotation',
      name: 'MaterialQuotation',
      component: () => import('@/views/spu/materialQuotation/index.vue'),
      meta: {
        roles: ['/spu/materialQuotation'],
        title: t('routes.spu.materialQuotation'),
      },
    },
    {
      path: 'mapQuotationDetail',
      name: 'MapQuotationDetail',
      component: () => import('@/views/spu/components/mapQuotationList/detail.vue'),
      meta: {
        hideMenu: true,
        // roles: ['/spu/mapQuotationDetail'],
        title: t('routes.spu.mapQuotationDetail'),
      },
    },
    {
      path: 'printQuotation',
      name: 'PrintQuotation',
      component: () => import('@/views/spu/printQuotation/index.vue'),
      meta: {
        roles: ['/spu/printQuotation'],
        title: t('routes.spu.printQuotation'),
      },
    },
    {
      path: 'processQuotation',
      name: 'ProcessQuotation',
      component: () => import('@/views/spu/processQuotation/index.vue'),
      meta: {
        roles: ['/spu/processQuotation'],
        title: t('routes.spu.processQuotation'),
      },
    },
    {
      path: 'ladderQuotationDetail',
      name: 'LadderQuotationDetail',
      component: () => import('@/views/spu/components/ladderQuotationList/detail.vue'),
      meta: {
        hideMenu: true,
        // roles: ['/spu/ladderQuotationDetail'],
        title: t('routes.spu.ladderQuotationDetail'),
      },
    },
    {
      path: 'spuSetting',
      name: 'SpuSetting',
      component: () => import('@/views/spu/spu/setting/index.vue'),
      meta: {
        hideMenu: true,
        // roles: ['/spu/spuSetting'],
        title: t('routes.spu.spuSetting'),
      },
    },
    // {
    //   path: 'machineSize',
    //   name: 'MachineSize',
    //   component: () => import('@/views/spu/machineSize/index.vue'),
    //   meta: {
    //     title: t('routes.spu.machineSize'),
    //   },
    // },
    {
      path: 'materialLoss',
      name: 'MaterialLoss',
      component: () => import('@/views/spu/materialLoss/index.vue'),
      meta: {
        roles: ['/spu/materialLoss'],
        title: t('routes.spu.materialLoss'),
      },
    },
    {
      path: 'profitAllocation',
      name: 'ProfitAllocation',
      component: () => import('@/views/spu/profitAllocation/index.vue'),
      meta: {
        roles: ['/spu/profitAllocation'],
        title: t('routes.spu.profitAllocation'),
      },
    },
    {
      path: 'minimumCharge',
      name: 'MinimumCharge',
      component: () => import('@/views/spu/minimumCharge/index.vue'),
      meta: {
        roles: ['/spu/minimumCharge'],
        title: t('routes.spu.minimumCharge'),
      },
    },
    {
      path: 'invoice',
      name: 'Invoice',
      component: () => import('@/views/spu/invoice/index.vue'),
      meta: {
        roles: ['/spu/invoice'],
        title: t('routes.spu.invoice'),
      },
    },
    // {
    //   path: 'product',
    //   name: 'Product',
    //   component: () => import('@/views/spu/product/index.vue'),
    //   meta: {
    //     title: t('routes.spu.product'),
    //   },
    // },
  ],
};

export default homeRoute;
